<template>
  <div>
    <swiper ref="mySwiper" :options="swiperOptions">

      <swiper-slide v-for="item of homesliderjson" :key="item.id">
        <img :src="item.imgurl" alt="" />
      </swiper-slide>
      
      
      <div class="swiper-pagination" slot="pagination"></div>
    </swiper>
  </div>
</template>

<script>
export default {
  name: "HomeSlider",
  props:['homesliderjson'],
  data() {
    return {
      swiperOptions: {
        pagination: {
          el: ".swiper-pagination",
        },
        // Some Swiper option/callback...
      }
    };
  },
  computed: {
    swiper() {
      return this.$refs.mySwiper.$swiper;
    },
  },
  mounted() {
    console.log("Current Swiper instance object", this.swiper);
    this.swiper.slideTo(3, 1000, false);
  },
};
</script>

<style lang="scss" scoped>
@import "@/assets/css/main.scss";
</style>